<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    *{
      margin: 0;
      padding: 0;
    }
    .nav{
      width: 800px;
      background-color: green;
      overflow: hidden;
      margin:  0 auto;
    }
    .nav li{
      list-style: none;
      float: left;
      width: 100px;
      height: 30px;
      line-height: 30px;
      color: #fff;
      font-size: 16px;
      text-align: center;
    }
    @media screen and  (max-width: 799px){
      .nav{
        width: 100%;
      }
      .nav li {
        width: 33.33%;
        

      }
    }
  </style>
</head>
<body>
  <ul class="nav">
    <li>首页</li>
    <li>首页</li>
    <li>首页</li>
    <li>首页</li>
    <li>首页</li>
    <li>首页</li>
    <li>首页</li>
    <li>首页</li>
  </ul>
</body>
</html>